#ifndef MATHOPERATIONS_HPP_INCLUDED
#define MATHOPERATIONS_HPP_INCLUDED

#include <cmath>
#include "MathConstants.h"
#include <RenderSubSystem/cvIPrimitives.h>

// This header provides various mathematical operations wich have no logical category yet.
namespace cvMath
{
	template<typename T> T wrapDegree( const T & angle );
	template<typename T> T wrapRadian( const T & angle );

	template<typename T> T clamp(T value, const T &min, const T &max);

	namespace priv
	{	// hide function:
		float QqhToRGB(float q1, float q2, float hue);
	};
	RGBAf HLSAf(float hue, float light, float sat, float a);

	// Floating point RGBA <--> integer RGBA.
	// NOTE: c should be clamp'ed if it is not in range.
	RGBAi RGBAtoi(const RGBAf & c);
	RGBAf RGBAtof(const RGBAi & c);

/// TEMPLATE IMPLEMENTATION...
#include "../../impl/Math/Operations.inl"

};
#endif // MATHOPERATIONS_HPP_INCLUDED
